package net.hn.hnms.biz.plan.company.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.plan.company.service.CompanyStatisticService;
import net.hn.hnms.biz.plan.vo.MonthValue;
import net.hn.hnms.biz.plan.vo.FootAgeVo;
import net.hn.hnms.biz.plan.service.IStatisticService;
import net.hn.hnms.biz.plan.vo.PlanStatisticVO;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;



@Api(value = "计划公司统计相关", tags = {"计划公司统计相关"})
@RestController
@RequestMapping("/companyStatistic")
@EnableScheduling
public class CompanyStatisticController {

    @Autowired
    private IStatisticService statisticService;
    @Autowired
    private CompanyStatisticService companyStatisticService;



    @ApiOperation("公司端-生产计划统计")
//    @SaCheckPermission("mining:face:add")
    @GetMapping("/plan/complete")
    @AutoSetMineCode
    public R<Map<String, PlanStatisticVO>> planComplete(Integer month, String companyCode) {
        return R.ok(statisticService.planComplete2(month, companyCode));
    }

    @ApiOperation("公司端-月产统计")
//    @SaCheckPermission("mining:face:add")
    @GetMapping("/plan/outputCount")
    @AutoSetMineCode
    public R<List<PlanStatisticVO>> outputCount(Integer month, String companyCode) {
        return R.ok(companyStatisticService.outputCountmonthAndYear(month, companyCode));
    }
    @ApiOperation("公司端-回采进度")
//    @SaCheckPermission("mining:face:add")
    @GetMapping("/plan/mining")
    @AutoSetMineCode
    public R<FootAgeVo> miningCount(Integer month, String companyCode) {
        return R.ok(companyStatisticService.miningCount(month, companyCode));
    }

    @ApiOperation("公司端-掘进进度")
//    @SaCheckPermission("mining:face:add")
    @GetMapping("/plan/drivage")
    @AutoSetMineCode
    public R<FootAgeVo> drivageCount(Integer month, String companyCode) {
        return R.ok(companyStatisticService.drivageCount(month, companyCode));
    }

    @ApiOperation("经营综合概览-洗选")
    @GetMapping("/washing")
    @AutoSetMineCode
    public R<List<MonthValue>> washing(Integer month, String companyCode) {
        return R.ok(companyStatisticService.washing(month,companyCode));
    }

    @ApiOperation("经营综合概览-洗选昨日")
    @GetMapping("/washingOfyesterDay")
    @AutoSetMineCode
    public R<MonthValue> washingOfyesterday(String companyCode) {
        return R.ok(companyStatisticService.washingOfyesterDay(companyCode));
    }


}
